home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 February
/
Macworld (1998-02).dmg
/
Inside Macworld
/
Alphamania 2 & Effector Sets
/
AlphaMania 2
/
Set FX.dir
/
00191_Script_Mode Buttons
< prev
next >
Wrap
Text File
|
1997-12-19
|
2KB
|
86 lines
property pSpriteList, pCurActive, pCallBackObj, pRefcon
on new me, propList
set pSpriteList = getAProp(propList,#sprites)
set pCurActive = getAProp(propList,#cur)
set pCallBackObj = getAProp(propList,#callback)
set pRefCon = getAProp(propList,#ref)
SetActive(me, pCurActive)
if pCurActive > count(pSpriteList) then set pCurActive = 0
return(me)
end
on Click me, sNum
if not integerP(sNum) then set sNum = the clickOn
if the memberNum of sprite sNum < 1 then exit
if not (the name of the member of sprite sNum contains "mode") then exit
put the name of the member of sprite sNum into memName
if memName contains "down" then exit
set the member of sprite sNum = member (memName&&"Down")
updateStage
set selected = TRUE
repeat while the stillDown
if rollover(sNum) then
set the member of sprite sNum = member (memName&&"Down")
set selected = TRUE
else
set the member of sprite sNum = member (memName)
set selected = FALSE
end if
updateStage
end repeat
put getPos(pSpriteList,sNum) into newNum
SetActive(me,newNum)
if objectP(pCallBackObj) then
put word 1 of memName into name
delete char 1 to 4 of name
changeMode(fxCurObj,value("#"&name))
end if
return(pCurActive)
end
on SetActive me, newNum
set pCurActive = newNum
repeat with i = 1 to count(pSpriteList)
put getAt(pSpriteList,i) into sNum
puppetSprite sNum, TRUE
put word 1 of the name of the member of sprite sNum into memname
if i = pCurActive then
set the member of sprite sNum = member (memname&&"Down")
else
set the member of sprite sNum = member memname
end if
end repeat
--updateStage
end
on ThisYou me, sNum
repeat with i = 1 to count(pSpriteList)
if(getAt(pSpriteList, i) = sNum) then
return TRUE
end if
end repeat
return FALSE
end
on GetActiveMode me
return(pCurActive)
end
on Release me
repeat with i = 1 to count(pSpriteList)
puppetSprite getAt(pSpriteList,i), FALSE
end repeat
end